<?php
$mid = intval($_GET['to']);
$memberinfo = $member->getById($mid);
?>
<div  class="title_mb_bg2 add_friend">

    <ul>

        <li>
            <div class="col_l"><a href="<?php echo DOMAIN . "/thanh-vien?mid=" . $memberinfo['id']; ?>" target="_parent"><img src="<?php echo $common->get_avatar_thumb($memberinfo['avatar']); ?>"></a></div>
            <div class="col_r"><h4><a href="<?php echo DOMAIN . "/thanh-vien?mid=" . $memberinfo['id']; ?>" target="_parent"><?php echo $memberinfo['fullname']; ?></a></h4>
                <?php
                $rsGroup = $member->getAllGroup();
                if($db->num_rows($rsGroup)){
                ?>
                <select id="group_id">
                    <?php
                    while ($row = $db->fetch_array($rsGroup)) {
                        echo '<option value="' . $row['id'] . '">' . $row['group_name'] . '</option>';
                    }
                    ?>
                </select>
                <?php
                }else{
                ?>
                <input type="text" id="group_name" value="Bạn bè" style="width: 250px;"/>
                <?php
                }
                ?>
                <input type="hidden" id="friend_id" value="<?php echo $mid;?>"/>
            </div>
        </li>
        <li class="end">
            <div class="col_l">Lời nhắn</div>
            <div class="col_r"><textarea id="msg" rows="4" class="inputtext"></textarea></div>
        </li>

    </ul>
    <div class="button_bottom">
        <div class="btn-left-02"><input type="button" onclick="AddFriend();" name="btncreateGroup" value="Gửi" class="btnBlogComment left"></div>
        <div class="btn-left-07"><input type="button" onclick="window.parent.Lightbox.hide();" value="Hủy bỏ" class="left button"></div>
        <img class="loading" style="display:none" src="/images/loading_small.gif">
        <div class="clear"></div>
    </div>
    <div class="clear"></div>
    <div id="message_alert_content" class="error"></div>
</div>
</div>

<script src="/js/add-friend.js" type="text/javascript"></script>

